<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tinyOS: tMemBlock.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">tinyOS
   &#160;<span id="projectnumber">v1.00</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('t_mem_block_8c_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">tMemBlock.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="t_mem_block_8c.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="t_mem_block_8h.html">tMemBlock.h</a>&quot;</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="tiny_o_s_8h.html">tinyOS.h</a>&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;</div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#if !defined(TINYOS_ENABLE_MEMBLOCK) || TINYOS_ENABLE_MEMBLOCK == 1</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#ga5af4d0c00dfeb923f7157c8f80692553">   27</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#ga5af4d0c00dfeb923f7157c8f80692553">tMemBlockInit</a> (<a class="code" href="struct__t_mem_block.html">tMemBlock</a> *memBlock, <span class="keywordtype">void</span> *memStart, uint32_t blockSize, uint32_t blockCnt) {</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;    uint8_t *memBlockStart = (uint8_t *) memStart;</div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    uint8_t *memBlockEnd = memBlockStart + blockSize * blockCnt;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;    <span class="comment">// 每个存储块需要来放置链接指针，所以空间至少要比tNode大</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;    <span class="comment">// 即便如此，实际用户可用的空间并没有少</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;    <span class="keywordflow">if</span> (blockSize &lt; <span class="keyword">sizeof</span>(<a class="code" href="struct__t_snode.html">tSnode</a>)) {</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;        <span class="keywordflow">return</span>;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;    }</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;    <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga5ca43de9442770133c4c2ac38e696049">tEventInit</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>, <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gga38c1e3a16130027049cb697b78b5d11ca8d21e2799dc4f2901d5e2b4c2e85b4fd">tEventTypeMemBlock</a>);</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;    memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a278e5d28605731490bb61cb8d313a5f3">memStart</a> = memStart;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    memBlock-&gt;<a class="code" href="struct__t_mem_block.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a> = blockSize;</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;    memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a1cc8a4ba5eee24b560f9869012941e91">maxCount</a> = blockCnt;</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;    <a class="code" href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gaf8a78399b0ba1d065066ad9766773f46">tSlistInit</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a097b552e5270ca956f34af77c4b5aadf">blockList</a>);</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;    <span class="keywordflow">while</span> (memBlockStart &lt; memBlockEnd) {</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        <a class="code" href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gacc07a6fb55e3ba70ace665ecfc2e45e8">tSnodeInit</a>((<a class="code" href="struct__t_snode.html">tSnode</a> *) memBlockStart);</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;        <a class="code" href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gaf1703fe22c881d476c7d722416c5f323">tSListAddLast</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a097b552e5270ca956f34af77c4b5aadf">blockList</a>, (<a class="code" href="struct__t_snode.html">tSnode</a> *)memBlockStart);</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;        memBlockStart += blockSize;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;    }</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;}</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#ga1ffdf77b2ef5b1e59f0738c018747af5">   59</a></span>&#160;uint32_t <a class="code" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#ga1ffdf77b2ef5b1e59f0738c018747af5">tMemBlockWait</a> (<a class="code" href="struct__t_mem_block.html">tMemBlock</a> *memBlock, <span class="keywordtype">void</span> **mem, uint32_t waitTicks) {</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;    <span class="comment">// 首先检查是否有空闲的存储块</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga787144c85b33b5e1a0ac251f154ae285">tSlistCount</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a097b552e5270ca956f34af77c4b5aadf">blockList</a>) &gt; 0) {</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;        <span class="comment">// 如果有的话，取出一个</span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;        *mem = (uint8_t *) <a class="code" href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga9cca374b0d96db129d694861c3ce7d6d">tSListRemoveFirst</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a097b552e5270ca956f34af77c4b5aadf">blockList</a>);</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;        <span class="comment">// 然后将任务插入事件队列中</span></div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;        <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga0bbda829b0d83072138caad66f98899a">tEventWait</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>, <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>, (<span class="keywordtype">void</span> *) 0, <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gga38c1e3a16130027049cb697b78b5d11ca8d21e2799dc4f2901d5e2b4c2e85b4fd">tEventTypeMemBlock</a>, waitTicks);</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <span class="comment">// 最后再执行一次事件调度，以便于切换到其它任务</span></div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a>();</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        <span class="comment">// 当切换回来时，从tTask中取出获得的消息</span></div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;        *mem = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#ae1ae004c581e0cc9fd22662535700001">eventMsg</a>;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        <span class="comment">// 取出等待结果</span></div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">waitEventResult</a>;</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    }</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;}</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#gac5c449adc2d5137dad06af15945cb160">   90</a></span>&#160;uint32_t <a class="code" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#gac5c449adc2d5137dad06af15945cb160">tMemBlockNoWaitGet</a> (<a class="code" href="struct__t_mem_block.html">tMemBlock</a> *memBlock, <span class="keywordtype">void</span> **mem) {</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    <span class="comment">// 首先检查是否有空闲的存储块</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga787144c85b33b5e1a0ac251f154ae285">tSlistCount</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a097b552e5270ca956f34af77c4b5aadf">blockList</a>) &gt; 0) {</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;        <span class="comment">// 如果有的话，取出一个</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;        *mem = (uint8_t *) <a class="code" href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga9cca374b0d96db129d694861c3ce7d6d">tSListRemoveFirst</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a097b552e5270ca956f34af77c4b5aadf">blockList</a>);</div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;        <span class="comment">// 否则，返回资源不可用</span></div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;        <span class="keywordflow">return</span> <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aa255993b8e7a6ec085f545b2cb4b0e161">tErrorResourceUnavaliable</a>;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    }</div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;}</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#ga7d3a796b2adc7cae76cdc6dd4eadc3d6">  111</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#ga7d3a796b2adc7cae76cdc6dd4eadc3d6">tMemBlockNotify</a> (<a class="code" href="struct__t_mem_block.html">tMemBlock</a> *memBlock, <span class="keywordtype">void</span> *mem) {</div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    <span class="comment">// 检查是否有任务等待</span></div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2">tEventWaitCount</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>) &gt; 0) {</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;        <span class="comment">// 如果有的话，则直接唤醒位于队列首部（最先等待）的任务</span></div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;        <a class="code" href="struct__t_task.html">tTask</a> *task = <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gae1e675e01faa9fd2a37ab29b2092d646">tEventWakeUp</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>, (<span class="keywordtype">void</span> *) mem, <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a>);</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;        <span class="comment">// 如果这个任务的优先级更高，就执行调度，切换过去</span></div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        <span class="keywordflow">if</span> (task-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a> &lt; <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a>-&gt;<a class="code" href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">prio</a>) {</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;            <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a>();</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        }</div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;    } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;        <span class="comment">// 如果没有任务等待的话，将存储块插入到队列中</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;        <a class="code" href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gaf1703fe22c881d476c7d722416c5f323">tSListAddLast</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a097b552e5270ca956f34af77c4b5aadf">blockList</a>, (<a class="code" href="struct__t_snode.html">tSnode</a> *) mem);</div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;    }</div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;}</div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#gacb1cf37f4aa43734f48d3faee0883a13">  136</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#gacb1cf37f4aa43734f48d3faee0883a13">tMemBlockGetInfo</a> (<a class="code" href="struct__t_mem_block.html">tMemBlock</a> *memBlock, <a class="code" href="struct__t_mem_block_info.html">tMemBlockInfo</a> *info) {</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;</div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;    <span class="comment">// 拷贝需要的信息</span></div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    info-&gt;<a class="code" href="struct__t_mem_block_info.html#a86988a65e0d3ece7990c032c159786d6">count</a> = <a class="code" href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga787144c85b33b5e1a0ac251f154ae285">tSlistCount</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a097b552e5270ca956f34af77c4b5aadf">blockList</a>);</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;    info-&gt;<a class="code" href="struct__t_mem_block_info.html#a1cc8a4ba5eee24b560f9869012941e91">maxCount</a> = memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a1cc8a4ba5eee24b560f9869012941e91">maxCount</a>;</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    info-&gt;<a class="code" href="struct__t_mem_block_info.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a> = memBlock-&gt;<a class="code" href="struct__t_mem_block.html#ab6558f40a619c2502fbc24c880fd4fb0">blockSize</a>;</div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    info-&gt;<a class="code" href="struct__t_mem_block_info.html#a80462c64b9184115aa568f08227f7f4a">taskCount</a> = <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2">tEventWaitCount</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>);</div><div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;</div><div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;}</div><div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;</div><div class="line"><a name="l00153"></a><span class="lineno"><a class="line" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#gaee9913bc670870b17fa9dd86e125d1fe">  153</a></span>&#160;uint32_t <a class="code" href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#gaee9913bc670870b17fa9dd86e125d1fe">tMemBlockDestroy</a> (<a class="code" href="struct__t_mem_block.html">tMemBlock</a> *memBlock) {</div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    uint32_t status = <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a>();</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;</div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;    <span class="comment">// 清空事件控制块中的任务</span></div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    uint32_t count = <a class="code" href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gace850c06cc2fc2f07296e1eb4552030a">tEventRemoveAll</a>(&amp;memBlock-&gt;<a class="code" href="struct__t_mem_block.html#a8b516ab130f86e4b15ca025c98c3dc53">event</a>, (<span class="keywordtype">void</span> *) 0, <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aa6c274bf418a43d0cf80e68161aad9d8e">tErrorDel</a>);</div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;    <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a>(status);</div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;    <span class="comment">// 清空过程中可能有任务就绪，执行一次调度</span></div><div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;    <span class="keywordflow">if</span> (count &gt; 0) {</div><div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        <a class="code" href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a>();</div><div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;    }</div><div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;    <span class="keywordflow">return</span> count;</div><div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;}</div><div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;</div><div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;<span class="preprocessor">#endif // TINYOS_ENABLE_MEMBLOCK</span></div><div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;</div><div class="ttc" id="struct__t_mem_block_info_html"><div class="ttname"><a href="struct__t_mem_block_info.html">_tMemBlockInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00034">tMemBlock.h:34</a></div></div>
<div class="ttc" id="struct__t_task_html"><div class="ttname"><a href="struct__t_task.html">_tTask</a></div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00031">tTask.h:31</a></div></div>
<div class="ttc" id="struct__t_task_html_ae1ae004c581e0cc9fd22662535700001"><div class="ttname"><a href="struct__t_task.html#ae1ae004c581e0cc9fd22662535700001">_tTask::eventMsg</a></div><div class="ttdeci">void * eventMsg</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00058">tTask.h:58</a></div></div>
<div class="ttc" id="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_gaf1703fe22c881d476c7d722416c5f323"><div class="ttname"><a href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gaf1703fe22c881d476c7d722416c5f323">tSListAddLast</a></div><div class="ttdeci">void tSListAddLast(tSlist *slist, tSnode *snode)</div><div class="ttdef"><b>Definition:</b> <a href="t_slist_8c_source.html#l00083">tSlist.c:83</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_gga38c1e3a16130027049cb697b78b5d11ca8d21e2799dc4f2901d5e2b4c2e85b4fd"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gga38c1e3a16130027049cb697b78b5d11ca8d21e2799dc4f2901d5e2b4c2e85b4fd">tEventTypeMemBlock</a></div><div class="ttdef"><b>Definition:</b> <a href="t_event_8h_source.html#l00026">tEvent.h:26</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_gace850c06cc2fc2f07296e1eb4552030a"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gace850c06cc2fc2f07296e1eb4552030a">tEventRemoveAll</a></div><div class="ttdeci">uint32_t tEventRemoveAll(tEvent *event, void *msg, uint32_t result)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00163">tEvent.c:163</a></div></div>
<div class="ttc" id="struct__t_mem_block_html"><div class="ttname"><a href="struct__t_mem_block.html">_tMemBlock</a></div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00024">tMemBlock.h:24</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gab4d6c802c474b9071f48312bed3dec74"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gab4d6c802c474b9071f48312bed3dec74">tTaskEnterCritical</a></div><div class="ttdeci">tTaskCritical_t tTaskEnterCritical(void)</div><div class="ttdef"><b>Definition:</b> <a href="t_switch_8c_source.html#l00036">tSwitch.c:36</a></div></div>
<div class="ttc" id="struct__t_mem_block_html_a8b516ab130f86e4b15ca025c98c3dc53"><div class="ttname"><a href="struct__t_mem_block.html#a8b516ab130f86e4b15ca025c98c3dc53">_tMemBlock::event</a></div><div class="ttdeci">tEvent event</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00025">tMemBlock.h:25</a></div></div>
<div class="ttc" id="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97_html_gacb1cf37f4aa43734f48d3faee0883a13"><div class="ttname"><a href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#gacb1cf37f4aa43734f48d3faee0883a13">tMemBlockGetInfo</a></div><div class="ttdeci">void tMemBlockGetInfo(tMemBlock *memBlock, tMemBlockInfo *info)</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8c_source.html#l00136">tMemBlock.c:136</a></div></div>
<div class="ttc" id="struct__t_snode_html"><div class="ttname"><a href="struct__t_snode.html">_tSnode</a></div><div class="ttdef"><b>Definition:</b> <a href="t_lib_8h_source.html#l00072">tLib.h:72</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga312cd12071f2d18172b4020079af49a2"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga312cd12071f2d18172b4020079af49a2">tEventWaitCount</a></div><div class="ttdeci">uint32_t tEventWaitCount(tEvent *event)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00206">tEvent.c:206</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gaeb48f2b93febc962f23d9a6a72db9d8e"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gaeb48f2b93febc962f23d9a6a72db9d8e">tTaskSched</a></div><div class="ttdeci">void tTaskSched(void)</div><div class="ttdoc">任务调度接口。通过它来选择下一个具体的任务，然后切换至该任务运行。 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00126">tCore.c:126</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gga79eea102ac8c9dc0bcce5f8c63ccc55aa6c274bf418a43d0cf80e68161aad9d8e"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aa6c274bf418a43d0cf80e68161aad9d8e">tErrorDel</a></div><div class="ttdef"><b>Definition:</b> <a href="tiny_o_s_8h_source.html#l00037">tinyOS.h:37</a></div></div>
<div class="ttc" id="struct__t_mem_block_html_a278e5d28605731490bb61cb8d313a5f3"><div class="ttname"><a href="struct__t_mem_block.html#a278e5d28605731490bb61cb8d313a5f3">_tMemBlock::memStart</a></div><div class="ttdeci">void * memStart</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00027">tMemBlock.h:27</a></div></div>
<div class="ttc" id="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_gacc07a6fb55e3ba70ace665ecfc2e45e8"><div class="ttname"><a href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gacc07a6fb55e3ba70ace665ecfc2e45e8">tSnodeInit</a></div><div class="ttdeci">void tSnodeInit(tSnode *snode)</div><div class="ttdef"><b>Definition:</b> <a href="t_slist_8c_source.html#l00020">tSlist.c:20</a></div></div>
<div class="ttc" id="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97_html_gaee9913bc670870b17fa9dd86e125d1fe"><div class="ttname"><a href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#gaee9913bc670870b17fa9dd86e125d1fe">tMemBlockDestroy</a></div><div class="ttdeci">uint32_t tMemBlockDestroy(tMemBlock *memBlock)</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8c_source.html#l00153">tMemBlock.c:153</a></div></div>
<div class="ttc" id="struct__t_mem_block_info_html_ab6558f40a619c2502fbc24c880fd4fb0"><div class="ttname"><a href="struct__t_mem_block_info.html#ab6558f40a619c2502fbc24c880fd4fb0">_tMemBlockInfo::blockSize</a></div><div class="ttdeci">uint32_t blockSize</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00037">tMemBlock.h:37</a></div></div>
<div class="ttc" id="tiny_o_s_8h_html"><div class="ttname"><a href="tiny_o_s_8h.html">tinyOS.h</a></div></div>
<div class="ttc" id="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97_html_ga7d3a796b2adc7cae76cdc6dd4eadc3d6"><div class="ttname"><a href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#ga7d3a796b2adc7cae76cdc6dd4eadc3d6">tMemBlockNotify</a></div><div class="ttdeci">void tMemBlockNotify(tMemBlock *memBlock, void *mem)</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8c_source.html#l00111">tMemBlock.c:111</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga5ca43de9442770133c4c2ac38e696049"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga5ca43de9442770133c4c2ac38e696049">tEventInit</a></div><div class="ttdeci">void tEventInit(tEvent *event, tEventType type)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00021">tEvent.c:21</a></div></div>
<div class="ttc" id="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_ga9cca374b0d96db129d694861c3ce7d6d"><div class="ttname"><a href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga9cca374b0d96db129d694861c3ce7d6d">tSListRemoveFirst</a></div><div class="ttdeci">tSnode * tSListRemoveFirst(tSlist *slist)</div><div class="ttdef"><b>Definition:</b> <a href="t_slist_8c_source.html#l00101">tSlist.c:101</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gga79eea102ac8c9dc0bcce5f8c63ccc55aa255993b8e7a6ec085f545b2cb4b0e161"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aa255993b8e7a6ec085f545b2cb4b0e161">tErrorResourceUnavaliable</a></div><div class="ttdef"><b>Definition:</b> <a href="tiny_o_s_8h_source.html#l00036">tinyOS.h:36</a></div></div>
<div class="ttc" id="struct__t_mem_block_info_html_a1cc8a4ba5eee24b560f9869012941e91"><div class="ttname"><a href="struct__t_mem_block_info.html#a1cc8a4ba5eee24b560f9869012941e91">_tMemBlockInfo::maxCount</a></div><div class="ttdeci">uint32_t maxCount</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00036">tMemBlock.h:36</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga21b4efbc4cb710d7d0e71678d2b13e53"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga21b4efbc4cb710d7d0e71678d2b13e53">tTaskExitCritical</a></div><div class="ttdeci">void tTaskExitCritical(tTaskCritical_t status)</div><div class="ttdef"><b>Definition:</b> <a href="t_switch_8c_source.html#l00047">tSwitch.c:47</a></div></div>
<div class="ttc" id="struct__t_mem_block_html_a097b552e5270ca956f34af77c4b5aadf"><div class="ttname"><a href="struct__t_mem_block.html#a097b552e5270ca956f34af77c4b5aadf">_tMemBlock::blockList</a></div><div class="ttdeci">tSlist blockList</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00031">tMemBlock.h:31</a></div></div>
<div class="ttc" id="struct__t_task_html_a6871573fefee3ad102e26a09e7a2f493"><div class="ttname"><a href="struct__t_task.html#a6871573fefee3ad102e26a09e7a2f493">_tTask::prio</a></div><div class="ttdeci">uint32_t prio</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00045">tTask.h:45</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_ga0bbda829b0d83072138caad66f98899a"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#ga0bbda829b0d83072138caad66f98899a">tEventWait</a></div><div class="ttdeci">void tEventWait(tEvent *event, tTask *task, void *msg, uint32_t state, uint32_t timeout)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00035">tEvent.c:35</a></div></div>
<div class="ttc" id="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97_html_ga1ffdf77b2ef5b1e59f0738c018747af5"><div class="ttname"><a href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#ga1ffdf77b2ef5b1e59f0738c018747af5">tMemBlockWait</a></div><div class="ttdeci">uint32_t tMemBlockWait(tMemBlock *memBlock, void **mem, uint32_t waitTicks)</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8c_source.html#l00059">tMemBlock.c:59</a></div></div>
<div class="ttc" id="struct__t_mem_block_html_ab6558f40a619c2502fbc24c880fd4fb0"><div class="ttname"><a href="struct__t_mem_block.html#ab6558f40a619c2502fbc24c880fd4fb0">_tMemBlock::blockSize</a></div><div class="ttdeci">uint32_t blockSize</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00028">tMemBlock.h:28</a></div></div>
<div class="ttc" id="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_gaf8a78399b0ba1d065066ad9766773f46"><div class="ttname"><a href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#gaf8a78399b0ba1d065066ad9766773f46">tSlistInit</a></div><div class="ttdeci">void tSlistInit(tSlist *slist)</div><div class="ttdef"><b>Definition:</b> <a href="t_slist_8c_source.html#l00028">tSlist.c:28</a></div></div>
<div class="ttc" id="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97_html_ga5af4d0c00dfeb923f7157c8f80692553"><div class="ttname"><a href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#ga5af4d0c00dfeb923f7157c8f80692553">tMemBlockInit</a></div><div class="ttdeci">void tMemBlockInit(tMemBlock *memBlock, void *memStart, uint32_t blockSize, uint32_t blockCnt)</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8c_source.html#l00027">tMemBlock.c:27</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#gga79eea102ac8c9dc0bcce5f8c63ccc55aab8add26d1e8bad7b6abb3c0c453fcabc">tErrorNoError</a></div><div class="ttdef"><b>Definition:</b> <a href="tiny_o_s_8h_source.html#l00034">tinyOS.h:34</a></div></div>
<div class="ttc" id="struct__t_mem_block_info_html_a86988a65e0d3ece7990c032c159786d6"><div class="ttname"><a href="struct__t_mem_block_info.html#a86988a65e0d3ece7990c032c159786d6">_tMemBlockInfo::count</a></div><div class="ttdeci">uint32_t count</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00035">tMemBlock.h:35</a></div></div>
<div class="ttc" id="struct__t_mem_block_info_html_a80462c64b9184115aa568f08227f7f4a"><div class="ttname"><a href="struct__t_mem_block_info.html#a80462c64b9184115aa568f08227f7f4a">_tMemBlockInfo::taskCount</a></div><div class="ttdeci">uint32_t taskCount</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00038">tMemBlock.h:38</a></div></div>
<div class="ttc" id="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83_html_ga6f232fb9d8361d1071e4f621468e0ee1"><div class="ttname"><a href="group___xE5_x86_x85_xE6_xA0_xB8_xE6_xA0_xB8_xE5_xBF_x83.html#ga6f232fb9d8361d1071e4f621468e0ee1">currentTask</a></div><div class="ttdeci">tTask * currentTask</div><div class="ttdoc">当前任务：记录当前是哪个任务正在运行 </div><div class="ttdef"><b>Definition:</b> <a href="t_core_8c_source.html#l00017">tCore.c:17</a></div></div>
<div class="ttc" id="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97_html_gac5c449adc2d5137dad06af15945cb160"><div class="ttname"><a href="group___xE5_xAD_x98_xE5_x82_xA8_xE5_x9D_x97.html#gac5c449adc2d5137dad06af15945cb160">tMemBlockNoWaitGet</a></div><div class="ttdeci">uint32_t tMemBlockNoWaitGet(tMemBlock *memBlock, void **mem)</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8c_source.html#l00090">tMemBlock.c:90</a></div></div>
<div class="ttc" id="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8_html_ga787144c85b33b5e1a0ac251f154ae285"><div class="ttname"><a href="group___xE5_x8D_x95_xE5_x90_x91_xE9_x93_xBE_xE8_xA1_xA8.html#ga787144c85b33b5e1a0ac251f154ae285">tSlistCount</a></div><div class="ttdeci">uint32_t tSlistCount(tSlist *slist)</div><div class="ttdef"><b>Definition:</b> <a href="t_slist_8c_source.html#l00039">tSlist.c:39</a></div></div>
<div class="ttc" id="struct__t_mem_block_html_a1cc8a4ba5eee24b560f9869012941e91"><div class="ttname"><a href="struct__t_mem_block.html#a1cc8a4ba5eee24b560f9869012941e91">_tMemBlock::maxCount</a></div><div class="ttdeci">uint32_t maxCount</div><div class="ttdef"><b>Definition:</b> <a href="t_mem_block_8h_source.html#l00029">tMemBlock.h:29</a></div></div>
<div class="ttc" id="t_mem_block_8h_html"><div class="ttname"><a href="t_mem_block_8h.html">tMemBlock.h</a></div></div>
<div class="ttc" id="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97_html_gae1e675e01faa9fd2a37ab29b2092d646"><div class="ttname"><a href="group___xE4_xBA_x8B_xE4_xBB_xB6_xE6_x8E_xA7_xE5_x88_xB6_xE5_x9D_x97.html#gae1e675e01faa9fd2a37ab29b2092d646">tEventWakeUp</a></div><div class="ttdeci">tTask * tEventWakeUp(tEvent *event, void *msg, uint32_t result)</div><div class="ttdef"><b>Definition:</b> <a href="t_event_8c_source.html#l00068">tEvent.c:68</a></div></div>
<div class="ttc" id="struct__t_task_html_a37707d87e42a484588393e5b3683ffbb"><div class="ttname"><a href="struct__t_task.html#a37707d87e42a484588393e5b3683ffbb">_tTask::waitEventResult</a></div><div class="ttdeci">uint32_t waitEventResult</div><div class="ttdef"><b>Definition:</b> <a href="t_task_8h_source.html#l00059">tTask.h:59</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="t_mem_block_8c.html">tMemBlock.c</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
